import { Size, Coordinate } from "./utils.js";


export default class Position {
  $target;
  playground;
  size;
  start;
  end;
  move;

  setStart(event) {
    this.$target = $(event.target).closest('.time-scroller');
    // 开始位置
    this.start = new Coordinate(event.pageX, event.pageY);
    // 移动距离
    this.move = new Coordinate(0, 0);
    // 大小
    this.size = new Size(this.$target);
  }

  setMove(event) {
    const { left, right, top, bottom } = this.playground

    // console.log('move: => ', this.$target.height(), this.size.initH)
  }

  setEnd(event) {
    this.end = new Coordinate(event.pageX, event.pageY);
    this.setMove(event);
    this.size.update(this.$target);
    // console.log('end: => ', this)
  }
}